import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
	path: '/',
	name: 'index',
	component: () => import('../views/index/index'),
	children: [{
		path: '',
		name: 'home',
		component: () => import('../views/home/index')
	}, {
		path: '/library',
		name: 'library',
		component: () => import('../views/library/index')
	}, {
		path: '/ranking',
		name: 'ranking',
		component: () => import('../views/ranking/index')
	}, {
		path: '/ucenter',
		name: 'ucenter',
		component: () => import('../views/ucenter/index')
	}]
}, {
	path: '/catalog',
	name: 'catalog',
	component: () => import('../views/catalog/index')
}, {
	path: '/view',
	name: 'view',
	component: () => import('../views/view/index')
}, {
	path: '/*',
	name: 'Error',
	component: () => import('../views/error/index')
}]

const router = new VueRouter({
	routes
})

export default router